package com.adnaan.restaurant.service.impl;

import com.adnaan.restaurant.entity.SysUser;
import com.adnaan.restaurant.mapper.SysUserMapper;
import com.adnaan.restaurant.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * author: adnaan
 * create: 2023-11-22 15:40
 * Description:
 */
@Service
public class SysUserServiceImpl implements ISysUserService {

    @Autowired
    private SysUserMapper userMapper;

    @Override
    public SysUser selectUserByUserName(String userName) {
        return userMapper.selectUserByUserName(userName);
    }

    @Override
    public int register(SysUser user) {
        return userMapper.register(user);
    }

    @Override
    public int updateUser(SysUser sysUser) {
        return userMapper.updateUser(sysUser);
    }

    @Override
    public int updateAvatar(String url, Long userId) {
        return userMapper.updateAvatar(url, userId);
    }

    @Override
    public SysUser selectUserByUserId(Long userId) {
        return userMapper.selectUserByUserId(userId);
    }
}